<%--
  Created by IntelliJ IDEA.
  User: 13051
  Date: 2020/6/20
  Time: 16:16
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8"%>

<%
    java.sql.Connection con=null;
    java.lang.String strConn;
    java.sql.Statement sqlStmt=null;
    java.sql.ResultSet sqlRst=null;

    try{
        Class.forName("com.mysql.cj.jdbc.Driver");
        con=java.sql.DriverManager.getConnection("jdbc:mysql://47.92.245.109:3306/Usystem?characterEncoding=UTF-8&serverTimezone=UTC&useSSL=false","root","xjs123456");
        sqlStmt=con.createStatement(java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE,java.sql.ResultSet.CONCUR_READ_ONLY);

        String sqlQuery="select * from user";
        sqlRst=sqlStmt.executeQuery(sqlQuery);

%>

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" type="image/png" sizes="16x16" href="plugins/images/favicon.png">
    <title>后端管理系统</title>
    <!-- Bootstrap Core CSS -->
    <link href="bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Menu CSS -->
    <link href="plugins/bower_components/sidebar-nav/dist/sidebar-nav.min.css" rel="stylesheet">
    <!-- animation CSS -->
    <link href="css/animate.css" rel="stylesheet">
    <!-- Custom CSS -->
    <link href="css/style.css" rel="stylesheet">
    <!-- color CSS -->
    <link href="css/colors/blue-dark.css" id="theme" rel="stylesheet">
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>
<!-- Preloader -->
<div class="preloader">
    <div class="cssload-speeding-wheel"></div>
</div>
<div id="wrapper">
    <!-- Navigation -->
    <nav class="navbar navbar-default navbar-static-top m-b-0">
        <div class="navbar-header"> <a class="navbar-toggle hidden-sm hidden-md hidden-lg " href="javascript:void(0)" data-toggle="collapse" data-target=".navbar-collapse"><i class="fa fa-bars
"></i></a>
            <div class="top-left-part"><a class="logo" href="index.html"><b><img src="plugins/images/pixeladmin-logo.png" alt="home" /></b><span class="hidden-xs"><img src="plugins/images/pixeladmin-text.png" alt="home" /></span></a></div>
            <ul class="nav navbar-top-links navbar-left m-l-20 hidden-xs">
                <li>
                    <form role="search" class="app-search hidden-xs">
                        <input type="text" placeholder="Search..." class="form-control"> <a href=""><i class="fa fa-search"></i></a>
                    </form>
                </li>
            </ul>
            <ul class="nav navbar-top-links navbar-right pull-right">
                <li>
                    <a class="profile-pic" href="#"> <img src="plugins/images/users/varun.jpg" alt="user-img" width="36" class="img-circle"><b class="hidden-xs">Steave</b> </a>
                </li>
            </ul>
        </div>
        <!-- /.navbar-header -->
        <!-- /.navbar-top-links -->
        <!-- /.navbar-static-side -->
    </nav>
    <!-- Left navbar-header -->
    <div class="navbar-default sidebar" role="navigation">
        <div class="sidebar-nav navbar-collapse slimscrollsidebar">
            <ul class="nav" id="side-menu">
                <li style="padding: 10px 0 0;">
                    <a href="index" class="waves-effect"><i class="fa fa-clock-o fa-fw" aria-hidden="true"></i><span class="hide-menu">index</span></a>
                </li>
                <li style="padding: 10px 0 0;">
                    <a href="userindex" class="waves-effect"><i class="fa fa-clock-o fa-fw" aria-hidden="true"></i><span class="hide-menu">住户账号管理</span></a>
                </li>
                <li>
                    <a href="inandout" class="waves-effect"><i class="fa fa-user fa-fw" aria-hidden="true"></i><span class="hide-menu">住户出去次数统计</span></a>
                </li>
                <li>
                    <a href="health" class="waves-effect"><i class="fa fa-user fa-fw" aria-hidden="true"></i><span class="hide-menu">住户健康信息统计</span></a>
                </li>
                <li>
                    <a href="search" class="waves-effect"><i class="fa fa-user fa-fw" aria-hidden="true"></i><span class="hide-menu">综合查询</span></a>
                </li>
            </ul>
            <div class="center p-20">
                <span class="hide-menu"><a href="#" target="_blank" class="btn btn-danger btn-block btn-rounded waves-effect waves-light">Upgrade to Pro</a></span>
            </div>
        </div>
    </div>
    <!-- Left navbar-header end -->
    <!-- Page Content -->
    <div id="page-wrapper">
        <div class="container-fluid">
            <div class="row bg-title">
                <div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
                    <h4 class="page-title">住户账号管理</h4> </div>
                <div class="col-lg-9 col-sm-8 col-md-8 col-xs-12"> <a href="#" class="btn btn-danger pull-right m-l-20 btn-rounded btn-outline hidden-xs hidden-sm waves-effect waves-light">Upgrade to Pro</a>
                    <ol class="breadcrumb">
                        <li><a href="#">Dashboard</a></li>
                        <li class="active">住户账号管理</li>
                    </ol>
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /row -->
            <div class="row">
                <div class="col-sm-12">
                    <div class="white-box">
                        <h3 class="box-title">名单</h3>
                        <div class="table-responsive">
                            <table class="table">
                                <thead>
                                <tr>
                                    <th>openid</th>
                                    <th>account</th>
                                    <th>password</th>
                                    <th>name</th>
                                    <th>cardid</th>
                                    <th>houseid</th>
                                    <th>power</th>
                                    <th>status</th>
                                </tr>
                                </thead>
                                <% while(sqlRst.next()) { %>
                                <tbody>
                                <tr>
                                    <td> <%=sqlRst.getString("openid") %> </td>
                                    <td> <%=sqlRst.getString("account") %> </td>
                                    <td> <%=sqlRst.getString("password") %> </td>
                                    <td> <%=sqlRst.getString("name") %> </td>
                                    <td> <%=sqlRst.getString("cardid") %> </td>
                                    <td> <%=sqlRst.getString("houseid") %> </td>
                                    <td> <%=sqlRst.getString("power") %> </td>
                                    <td> <%=sqlRst.getString("status") %> </td>
                                    <td><a  href="power?id=<%=sqlRst.getString("openid")%>">授权</a></td>
                                    <td><a  href="power1?id=<%=sqlRst.getString("openid")%>">解除授权</a></td>
                                    <td><a  href="lock?id=<%=sqlRst.getString("openid")%>">锁定</a></td>
                                    <td><a  href="unlock?id=<%=sqlRst.getString("openid")%>">解锁</a></td>
                                </tr>
                                <%} %>

                                </tbody>

                            </table>
                            <%
                                }catch(java.sql.SQLException e){
                                    out.println(e.toString());
                                }finally{
                                    if(sqlRst!=null) sqlRst.close();
                                    if(sqlStmt!=null) sqlStmt.close();
                                    if(con!=null) con.close();
                                }
                            %>
                        </div>
                    </div>
                </div>
            </div>
            <!-- /.row -->
        </div>
        <!-- /.container-fluid -->
        <footer class="footer text-center">  <a href="http://www.cssmoban.com/" target="_blank" title="模板之家"></a>  <a href="http://www.cssmoban.com/" title="网页模板" target="_blank"></a> </footer>
    </div>
    <!-- /#page-wrapper -->
</div>
<!-- /#wrapper -->
<!-- jQuery -->
<script src="plugins/bower_components/jquery/dist/jquery.min.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="bootstrap/dist/js/bootstrap.min.js"></script>
<!-- Menu Plugin JavaScript -->
<script src="plugins/bower_components/sidebar-nav/dist/sidebar-nav.min.js"></script>
<!--slimscroll JavaScript -->
<script src="js/jquery.slimscroll.js"></script>
<!--Wave Effects -->
<script src="js/waves.js"></script>
<!-- Custom Theme JavaScript -->
<script src="js/custom.min.js"></script>
</body>

</html>

